home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / buildPerspLookthruMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.2 KB  |  69 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // $RCSfile: buildPerspLookthruMenu.mel $
  19. // $Revision: /main/3 $
  20. // $Date: 1997/09/08 16:32:49 $
  21. //
  22. //  Alias|Wavefront Script File
  23. //  MODIFY THIS AT YOUR OWN RISK
  24. //
  25. //  Author:         cdt
  26. //
  27. //  Procedure Name:
  28. //      buildPerspLookthruMenu
  29. //
  30. //  Description:
  31. //      This procedure creates a menu item for each perspective
  32. //      camera. New cameras can also be created through this
  33. //      menu. When a menu item is selected the associated camera will
  34. //      be placed in the model view.
  35. //
  36. //  Input Arguments:
  37. //      parent - menu name to build menu items for
  38. //      panel - name of panel this menu is associated with
  39. //
  40. //  Return Value:
  41. //      None.
  42. //
  43.  
  44. global proc buildPerspLookthruMenu( string $parent, string $panel )
  45. {
  46.     string $cameras[] = `listCameras -perspective`;
  47.  
  48.     if (associateWithKey($parent, $cameras)) return;
  49.  
  50.     // Rebuild menu
  51.     //
  52.  
  53.     setParent -m $parent;
  54.  
  55.     menu -e -deleteAllItems $parent;
  56.  
  57.     for ($camera in $cameras) {
  58.         menuItem -l $camera -command
  59.             ("lookThroughModelPanel "+$camera+" "+$panel);
  60.     }
  61.  
  62.     menuItem -divider true;
  63.  
  64.     menuItem -l "New"
  65.         -c ("{ string $camera[] = `camera -n persp -hc \"viewSet -p %camera\"`; "+
  66.             "viewSet -p $camera[0]; "+
  67.             "lookThroughModelPanel $camera[0] "+$panel+"; }");
  68. }
  69.